import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: '/dept',
        name: 'dept',
        component: () => import('../components/admin/dept/DeptView.vue')
      },
      {
        path: '/role',
        name: 'role',
        component: () => import('../components/admin/role/RoleTable.vue')
      },
      {
        path: '/todo',
        name: 'todo',
        component: () => import('../components/admin/todo/TodoTable.vue')
      }
    ]
  },
  {
    path: '/about',
    name: 'about',
    component: () => import('../views/AboutView.vue')
  }
]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
